package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.SAnsweringMapper;
import com.education.welco.pojo.SAnswering;
import com.education.welco.service.ISAnsweringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 教师答疑 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class SAnsweringServiceImpl implements ISAnsweringService {

    @Autowired
    private SAnsweringMapper sAnsweringMapper;


    /**
     * 查询教师答疑信息
     *
     * @param list 教师答疑ID 集合
     * @return 教师答疑信息
     */
    @Override
    public List<SAnswering> selectSAnsweringByIds(List<Integer> list) {
        return sAnsweringMapper.selectSAnsweringByIds(list);
    }

    /**
     * 查询教师答疑信息
     *
     * @param catalogId 教师答疑ID
     * @return 教师答疑信息
     */
    @Override
    public List<SAnswering> selectSAnsweringBycatalogId(Integer catalogId) {
        return sAnsweringMapper.selectSAnsweringBycatalogId(catalogId);
    }

    /**
     * 查询教师答疑信息
     *
     * @param id 教师答疑ID
     * @return 教师答疑信息
     */
    @Override
    public SAnswering selectSAnsweringById(Integer id) {
        return sAnsweringMapper.selectSAnsweringById(id);
    }

    /**
     * 查询教师答疑列表
     *
     * @param sAnswering 教师答疑信息
     * @return 教师答疑集合
     */
    @Override
    public List<SAnswering> selectSAnsweringList(SAnswering sAnswering) {
        return sAnsweringMapper.selectSAnsweringList(sAnswering);
    }

    /**
     * 新增教师答疑
     *
     * @param sAnswering 教师答疑信息
     * @return 结果
     */
    @Override
    public int insertSAnswering(SAnswering sAnswering) {
        return sAnsweringMapper.insertSAnswering(sAnswering);
    }


    /**
     * 删除教师答疑信息
     *
     * @param id 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSAnsweringById(Integer id) {
        return sAnsweringMapper.deleteSAnsweringById(id);
    }

    /**
     * 修改教师答疑
     *
     * @param sAnswering 教师答疑信息
     * @return 结果
     */
    @Override
    public int updateSAnswering(SAnswering sAnswering) {
        return sAnsweringMapper.updateSAnswering(sAnswering);
    }

    /**
     * 删除教师答疑对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSAnsweringByIds(String ids) {
        return sAnsweringMapper.deleteSAnsweringByIds(Convert.toStrArray(ids));
    }

    @Override
    public List<SAnswering> selectSAnsweringStuList(SAnswering sAnswering) {
        return sAnsweringMapper.selectSAnsweringStuList(sAnswering);
    }

    @Override
    public void selectCommentListById(String id, String userId, String type) {

    }
}